package com.blueheart.music.mapper;

import com.blueheart.music.model.pojo.Comment;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface CommentMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Comment record);

    int insertSelective(Comment record);

    Comment selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Comment record);

    int updateByPrimaryKey(Comment record);

    /**
     * 查询所有评论
     * @return
     */
    List<Comment> selectAll();

    /**
     * 查询所有歌单中评论
     * @param songListId
     * @return
     */
    List<Comment> selectBySongListId(Integer songListId);

    /**
     * 查询所有歌曲评论
     * @param songId
     * @return
     */
    List<Comment> selectBySongId(Integer songId);

    /**
     * 增加评论点赞数
     * @param record
     * @return
     */
    int updateByUp(Comment record);
}